package com.github.wxpay.plus;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties("wxpay")
@Data
public class WXConfig {
    private String appId;
    private String appSecret;
    private String mchId;
    private String partnerKey;
    private String notifyUrl = "";

    public static String successMsg() {
        return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
    }

    public static String failureMsg(String failureMsg) {
        return "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA["+failureMsg+"]]></return_msg></xml>";
    }

}